#ifndef ARTICLE_H
#define ARTICLE_H

#include <QString>
#include <QPushButton>
#include <QSqlQuery>
#include <QDebug>

class Article
{
public:
    enum {WAIT, TRANS, RECV};   // 物流状态
    enum {NORMAL, FRAG, BOOK};  // 物品类型
    Article();
    Article(QString sendTime, QString id, int type = NORMAL);
    void packet(QString sender, QString receiver, QString info = "null");   //  打包信息
    QString sent();    // 被寄出
    void received(QString recvTime); // 被签收
    virtual double getPrice();

protected:
    QString sendTime;
    QString recvTime;
    QString sender;
    QString receiver;
    QString info;
    QString id;
    int status;
    int type;
    double unit;    // 物品量
    QSqlDatabase db;
};

class Fragile : public Article {
public:
    Fragile();
    Fragile(QString sendTime, QString id, double unit);
    virtual double getPrice();
};

class Book : public Article {
public:
    Book();
    Book(QString sendTime, QString id, double unit);
    virtual double getPrice();
};

class Normal : public Article {
public:
    Normal();
    Normal(QString sendTime, QString id, double unit);
    virtual double getPrice();
};

#endif // ARTICLE_H
